alter table jms_dm.dm_tab_in_center_package_waybill_detail_dt
    set tblproperties ('external.table.purge' = 'true');
drop table jms_dm.dm_tab_in_center_package_waybill_detail_dt;
CREATE EXTERNAL TABLE if not exists jms_dm.dm_tab_in_center_package_waybill_detail_dt
(
    waybill_no            string comment '运单编号',
    input_site            string comment '扫描网点名称',
    scan_site_code        string comment '扫描网点编号',
    network_type          int comment    '扫描网点类型，1.加盟商,2.转运中心,3.集散点,4.普通网点,5.代理区,6.总部,0.其他',
    site_agent_code       string comment '所属代理区code',
    site_agent_name       string comment '所属代理区名称',
    scan_time             string comment '扫描时间',
    date_time             string comment '日期',
    package_length        double comment '包裹总长,单位厘米',
    package_wide          double comment '包裹总宽,单位厘米',
    package_high          double comment '包裹总高,单位厘米',
    goods_type_code       string comment '物品类型code',
    goods_type_name       string comment '物品类型名称',
    package_charge_weight decimal(14, 2) comment '包裹计费重量,单位千克',
    package_code          string comment '所属包号',
    second_code           string comment '运单二段码',
    third_code            string comment '运单三段码',
    second_package_code   string comment '包二段码',
    third_package_code    string comment '包三段码',
    scan_user             string comment '扫描员',
    pack_scan_time        string comment '建包扫描时间',
    need_way_flag         int comment '应建包票运单标识 1是,0否',
    error_pack_way_flag   int comment '错建包运单 0代表错建包运单 1代表未错建包运单'
)
    COMMENT '进港建包统计报表明细'
    PARTITIONED BY ( dt STRING COMMENT '建包时间')
    STORED AS PARQUET
    LOCATION '/dw/hive/jms_dm.db/external/dm_tab_in_center_package_waybill_detail_dt'
;
